﻿using Bootstrap5.Design;

namespace Bootstrap5;

/// <summary>
/// Represents a trigger for bootstrap.
/// </summary>
public static class Trigger
{
    public static TriggerProvider Dismiss(DismissName name) => new TriggerProvider().Dismiss(name);
    public static TriggerProvider Toggle(ToggleName name) => new TriggerProvider().Toggle(name);
    public static TriggerProvider Target(string name) => new TriggerProvider().Target(name);
    public static TriggerProvider AddTrigger(string name, object value) => new TriggerProvider().SetEvent(name, value);
    public static TriggerProvider Modal(ModalBackdrop backdrop = ModalBackdrop.True) => new TriggerProvider().SetEvent("backdrop", backdrop.GetEnumDefaultValue());

    public static TriggerProvider Tooltip(Placement? placement = default, bool isHtml = default)
        => Toggle(ToggleName.Tooltip)
        .SetEvent("placement",placement.HasValue? placement.GetEnumDefaultValue():"auto")
        .SetEvent("html", isHtml)
        ;

}
